cmake_minimum_required(VERSION 3.10.2)


project("spushrtmp")

file(GLOB all *.c *.cpp)

add_library(
        native-lib

        SHARED

        ${all})

#======================== rtmpDump start  ========================
add_subdirectory("${CMAKE_SOURCE_DIR}/librtmp")
#======================== rtmpDump end  ========================

#======================== x264 start  ========================
include_directories("${CMAKE_SOURCE_DIR}/x264/include") # 引入头文件
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/x264/libs/${CMAKE_ANDROID_ARCH_ABI}")# 引入库文件
#======================== x264 end  ========================

#======================== faac start  ========================
add_subdirectory("${CMAKE_SOURCE_DIR}/libfaac")
#======================== faac end  ========================

# 导入头文件路径 使引入时候变成: #include <rtmp.h>
include_directories(librtmp libfaac/include)

target_link_libraries(
        native-lib
        rtmp # 实时传输协议
        x264 # 视频高级编码
        faac # 音频高级编码
        log)